<?php
class Macys_Api_V3_Catalog_Product {

	private $endpoint = "/v3/catalog/product";
	private $service;
	private $uri;
	private $conf; // For Acessing stored info
	private $log;
	
	private $header_value = 'testclient_1.0_kweu3w323a';
	
	private $client; // Macys HTTP Client
	
	public function __construct() {
		$this->log = Zend_Registry::get('log');
		$this->client = new Macys_Base_HttpClient();
		$this->conf = Macys_Base_Config::getInstance();
		$this->client->setCurlSupport();
		$this->client->setMethod('GET');
		$this->client->setAcceptType();
		
	}

	
	public function getProduct($id) {
		$this->uri = $this->uri . '/' . $id;
		
		$this->client->setUri($this->uri);
		$this->setMashery();
		$this->client->request();
		return $this->client->getResponseBodyArray();
	}
	
	
	public function getProductIndex($ifModifiedSince=FALSE) {
		$url = $this->service . $this->endpoint . '/index';
		$this->client->setUri($url); 
	}
	
	
	
	private function setUrl() {
		$this->uri = $this->conf['wssg']['host'];
		$this->service = $this->conf['wssg']['host'];
		$this->uri = $this->uri . $this->endpoint;
		$this->log->debug("URI Retrived from Conf : " . $this->uri);
	}
	
	
	public function setMashery($flag=FALSE) {
		if ($flag ==  TRUE) {
			
		}
		else {
			$this->client->setClientHeader($this->header_value);
			$this->client->setCustomerHeader($this->header_value);
		}
	}


}